package com.solution.common.constants;

/**
 * 公用状态
 * 
 * @author huqian
 * 
 */
public class PublicStatus {

    // 异步操作标识
    public static final String RESULT_CODE = "resultCode";
    public static final String RESULT_MSG = "resultMsg";

    // 审批操作对象 示例：
    public enum APPROVE_TYPE {
        NORMAL("0", "CWSH", "财务审批"), OVER_AMOUNT("1", "CEDD", "超额订单审批"), CEMOTION("2", "PTKQ", "普通客情审批"), OVER_CEMOTION("3", "CEKQ", "超额客情审批"), DISCOUNT(
                "4", "ZKSQ", "折扣申请审批");
        private String approveType;
        private String approveKey;
        private String statement;

        private APPROVE_TYPE(String orderStatus, String approveKey, String statement) {
            this.approveType = orderStatus;
            this.approveKey = approveKey;
            this.statement = statement;
        }

        public String getApproveType() {
            return approveType;
        }

        public String getApproveKey() {
            return approveKey;
        }

        public String getStatement() {
            return statement;
        }
    }

    /**
     * 业务员充值方式
     * 
     * @author yaoyu
     * @date 2017年7月12日 上午9:12:13
     */
    public enum RECHARGE_TYPE {
        WX(0, "微信"), ZFB(1, "支付宝"), CASH(2, "现金"), BANK(3, "银行转账");
        private int code;
        private String name;

        private RECHARGE_TYPE(int code, String name) {
            this.code = code;
            this.name = name;
        }

        public int getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

        // 根据传入的编码获取对应的名称
        public static String getNameByCode(int code) {
            if (code == BANK.getCode()) {
                return BANK.getName();
            } else if (code == WX.getCode()) {
                return WX.getName();
            } else if (code == ZFB.getCode()) {
                return ZFB.getName();
            } else if (code == CASH.getCode()) {
                return CASH.getName();
            }
            return "";
        }
    }

    // 订单操作相关对象
    public enum ORDER_STATUS {
        NO_AUDIT("1", "未审核"), NO_DELIVER_GOODS("2", "待发货"), DELIVER_GOODS("3", "已发货"), CANCEL("4", "已取消"), REJECT_SIGN("5", "拒签"), REJECT_REQ("6",
                "驳回"), PART_SEND("7", "部分发货"), COMPLETE_SIGN("8", "已签收");
        private String orderStatus;
        private String statement;

        private ORDER_STATUS(String orderStatus, String statement) {
            this.orderStatus = orderStatus;
            this.statement = statement;
        }

        public String getOrderStatus() {
            return orderStatus;
        }

        public String getStatement() {
            return statement;
        }
    }

    // 支付方式操作相关状态
    public enum PAY_TYPE {
        PREPAYMENT("1", "预支付付款"), CASH("2", "现金付款"), PAY_ON_DELIEVERY("3", "货到付款"), PAY_ON_CREDIT("4", "欠款"), REFUND_ORDER_MONEY("5", "退款");
        private String payStatus;
        private String statement;

        private PAY_TYPE(String payStatus, String statement) {
            this.payStatus = payStatus;
            this.statement = statement;
        }

        public String getPayStatus() {
            return payStatus;
        }

        public String getStatement() {
            return statement;
        }
    }

    public enum PROMOTION_TYPE {
        fullReduce("1", "满减"), fullGive("2", "满赠"), buyGive("3", "买赠");
        private String promotionType;
        private String promotionName;

        private PROMOTION_TYPE(String promotionType, String promotionName) {
            this.promotionType = promotionType;
            this.promotionName = promotionName;
        }

        public String getPromotionType() {
            return promotionType;
        }

        public String getPromotionName() {
            return promotionName;
        }
    }

    // 记录状态 status
    public enum STATUS {
        ENABLED(1, "启用"), DISABLED(0, "停用");
        private Integer id;
        private String name;

        private STATUS(Integer id, String name) {
            this.id = id;
            this.name = name;
        }

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

    }
    
    /**
     * 用户审核状态
     */
    public enum USER_APPROVE_STATUS  {
    	AGREE(1, "同意"), PENDING(0, "待审核"), REJECT(2, "驳回");
        private Integer id;
        private String name;

        private USER_APPROVE_STATUS(Integer id, String name) {
            this.id = id;
            this.name = name;
        }

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    // 删除标记 is_delete
    public enum IS_DELETE {
        NORMAL(1, "正常"), DELETED(0, "已删除");
        private Integer id;
        private String name;

        private IS_DELETE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    /**
     * 请求返回码
     * 
     * @author xu_cc
     * @date 创建时间：2017年10月9日 下午3:52:57
     */
    public interface SysCode {
        /** 成功 */
        public static final String SUCCESS = "1";
        /** 失败 */
        public static final String FAILED = "0";
        /** 错误，异常 */
        public static final String ERROR = "-1";
    }

    /**
     * 特殊符号
     * 
     * @author xu_cc
     * @date 创建时间：2017年10月13日 上午9:57:51
     */
    public interface SysSymbol {
        /** 逗号（,） */
        public static final String COMMA = ",";
        /** 井号（#） */
        public static final String NUMBER_SIGN = "#";
        /** 冒号（:） */
        public static final String COLON = ":";
        /** 句号（.） */
        public static final String POINT = ".";
        /** 美元（$） */
        public static final String DOLLAR = "$";
        /** RMB（￥） */
        public static final String RMB = "￥";
        /** 下划线（_） */
        public static final String UNDERLINE = "_";
        /** 连接线（-） */
        public static final String LINE = "-";
        /** 邮箱@符合（@） */
        public static final String EMAIL = "@";
        /** 空格（ ） */
        public static final String SPACE = " ";

    }
    
    /**
     * 用户登录终端类型
     * @author lilp
     */
    public enum LOGIN_TERMINAL_TYPE {
        BK("BK", "微信"), PC("PC", "电脑"), WX("WX", "微信");
        private String code;
        private String name;

        private LOGIN_TERMINAL_TYPE(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }

    }
    
    /**
     * 付款方式 
     */
    public enum ALLOWED_PAY_TYPE {
    	IMMEDIATE("01", "立即付款"), DELIVERY("02", "货到付款");
        private String code;
        private String name;

        private ALLOWED_PAY_TYPE(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public String getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }
    
    /**
     * 是否允许用户退货 
     */
    public enum ALLOW_BACK_FLAG {
    	YES(1, "允许"), NO(0, "不允许");
        private Integer code;
        private String name;

        private ALLOW_BACK_FLAG(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }
    
    /**
     * 合作中 
     */
    public enum COPERATE_FLAG {
    	YES(1, "是"), NO(2, "否");
        private Integer code;
        private String name;

        private COPERATE_FLAG(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }
    
    /**
     * 用户类型 1 业务员 2 平台管理人员 3 经销商人员
     */
    public enum USER_TYPE  {
    	SALESMAN(1, "业务员 "), ADMIN(2, "平台管理人员"), DEALER(3, "经销商人员"), CUSTOMER(4, "客户");
        private Integer id;
        private String name;

        private USER_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
    
    /**
     * 公众号CLICK事件key值
     */
    public enum WECHAT_EVENT_KEY {
    	PROMOTIONS("promotions", "促销信息");
        private String key;
        private String name;

        private WECHAT_EVENT_KEY(String key, String name) {
            this.key = key;
            this.name = name;
        }

        public String getKey() {
            return key;
        }

        public String getName() {
            return name;
        }
    }
}